<script setup>
import {onMounted} from "vue";
import {getItem} from "./utils/WebUtil";
import { useRouter } from "vue-router"
import { useStore } from 'vuex';

onMounted(()=>{
    const router = useRouter()
    const auth=getItem('auth')
    if (auth===null)
        router.push('/login')
    else{
        const store=useStore()
        store.commit('setUser',auth)
    }
})
</script>

<template>
  <router-view/>
</template>

<style>
body{
    margin: 0;
}
</style>
